'use strict';
const db = uniCloud.database()
const coll = db.collection('user')
const coll2 = db.collection('guanzhong')
const dbCmd = db.command
exports.main = async (event, context) => {
	let res1 = await coll.where({
		flag: 'flag'
	}).update({
		status: 0,
		zongfen: 0,
		shijian: 0,
		tiNum: 1,
		tiku: [],

	})

	//清空游客
	let res2 = coll2.where({
		_id: dbCmd.exists(true)
	}).remove()

	/* let res2 = await coll2.where({
		flag: 'guanzhong'
	}).update({
		status: 0,
		zongfen: 0,
		shijian: 0,
		tiNum: 1,
		tiku: [],
	}) */
	return {
		msg: '成功'
	}
};
